package titt.service.content.listener;

import titt.util.io.pipe.PipeListener;

public class ForgivingListener implements PipeListener {

	private final PipeListener listener;
	
	public ForgivingListener(PipeListener listener) {
		this.listener = listener;
	}
	
	@Override
	public void onComplete(int total) {
		try {
			listener.onComplete(total);
		}
		catch(Exception e) {}
	}

	@Override
	public void onConnectionUpdate(int read, int total) {
		try {
			listener.onConnectionUpdate(read, total);
		}
		catch(Exception e) {}
	}

	@Override
	public void onError() {
		try {
			listener.onError();
		}
		catch(Exception e) {}
	}

	@Override
	public void onInitiate(int total) {
		try {
			listener.onInitiate(total);
		}
		catch(Exception e) {}
	}

}
